import { create } from 'zustand'
import { persist, createJSONStorage } from 'zustand/middleware'
const useBearStore = create(persist((set) => ({
  config: {},
  moduleList: [],
  userInfo: {},
  setConfig: (data) => set({ config: data }),
  setModuleList: (data) => set({ moduleList: data }),
  setUserInfo: (data) => set({ userInfo: data }),
}),{
  name: 'configStore',
  storage: createJSONStorage(() => localStorage),
  partialize: (state) => ({ config: state.config, moduleList: state.moduleList, userInfo: state.userInfo }),
}))
export default useBearStore